<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%@ include file="/common/grid/jqGrid.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="">
	<meta http-equiv="description" content="This is my page">
	
  </head>
  
  <body>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'待办假期申请管理'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="pvo.paperId" id="paperId"></s:hidden>
    		
    		<table cellspacing="1" width="100%" bgcolor="#CCCCCC">
				<tr bgcolor="#FFFFFF">
					<td align="right" width="15%" class="label">
						申请人编号：
					</td>
					<td align="left" width="35%">
						<s:textfield name="employeeNum" id="employeeNum" cssStyle="width:150px" cssClass="search pass"></s:textfield>
					</td>
					<td align="right" width="15%" class="label">
						申请人：
					</td>
					<td align="left" width="35%">
						<s:textfield name="employeeName" id="employeeName" cssStyle="width:150px" cssClass="search pass"></s:textfield>
					</td>
				</tr>
			</table>
			<table cellspacing="0" width="100%">
				<tr>
					<td align="left">
    					<input type="button" value="查询" class="btn" onclick="searchThis()" />
    					<input type="button" value="重置" class="btn" onclick="resetSearch()" />
    				</td>
    			</tr>
    		</table>
    		
    		<table id="listGrid" cellpadding="3" cellspacing="0"></table>
			<div id="pager" style="text-align:center;"></div>
    	</s:form>
    
    <script type="text/javascript">
    $(document).ready(function(){
        var cName = new Array('申请人编号', '申请人姓名', '从', '到', '日', '小时', '当前审批人', '审批状态', '操作');
    	var cModel = [
    					{name:'employeeNum', index:'employeeNum', width:'15%', align:'center'},
    					{name:'employeeName', index:'employeeName', width:'15%', align:'center'},
                        {name:'fromTime', index:'fromTime', width:'10%', align:'center', formatter:'date', formatoptions:{srcformat:'Y-m-d', newformat:'Y-m-d'}},
                        {name:'toTime', index:'toTime', width:'10%', align:'center', formatter:'date', formatoptions:{srcformat:'Y-m-d', newformat:'Y-m-d'}},
                        {name:'days', index:'days', width:'10%', align:'center'},
                        {name:'hours', index:'hours', width:'10%', align:'center'},
                        {name:'nodeName', index:'nodeName', width:'10%', align:'center'},
                        {name:'status', index:'status', width:'10%', align:'center'},
                        {name:'id', index:'id', width:'10%', align:'center', sortable:false, formatter:option}
                      ];
        
        newJqGrid({
        	id: 'id',
        	gridId: 'listGrid',
        	pagerId: 'pager',
        	url: 'inner/vacation/queryTaskVacation.action',
        	head: cName,
        	column: cModel,
        	width: getBodyWidth(),
        	height: 'auto',
        	hasCb: false,
        	title: '待办假期申请列表'
        });
        
        $(window).resize(function(){
        	gridAutoWidth('listGrid', 'win');
        });
    });
    
    function searchThis()
    {
    	toSearchList('listGrid', 'frm');
    }

    function updateObj(id)
    {
    	var url = realPath + '/inner/vacation/toSaveVacation.action?vacation.id=' + id;
    	window.location.href = url;
    }

    function option(cellVal, options, row)
    {
    	var html = '<a style="color:blue; text-decoration:underline" href="javascript:updateObj(\'' + row['id'] + '\')" >查看</a>';
    	return html;
    }
    </script>
  </body>
</html>
